package furnitureBuilder;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Bedroom implements Serializable{
	List<Item> items = new ArrayList<Item>();
	public String bedroomLumberType = " ";
	public String getBeedroomLumberType() {
		return bedroomLumberType;
	}
	
	/**
	 * Set the lumber type of room;
	 * @param beedroomType
	 */
	public void setBeedroomLumberType(String beedroomType) {
		this.bedroomLumberType = beedroomType;
	}
	
	/**
	 * Add room component
	 * @param item
	 */
	public void addItem(Item item) {
		items.add(item);
	}
	
	/**
	 * Get total cost of created room
	 * @return
	 */
	public float getTotalCost() {
		float totalCost = 0.00f;
		for(Item item : items) {
			totalCost += item.price();
		}
		return totalCost;
	}
	
	/**
	 * Print the information of specific part of room.
	 */
	public void showBedroomItems() {
		for(Item item : items) {
			System.out.println("Item: " + item.description());
			System.out.println("Item lumber type: " + item.lumberType());
			System.out.println("Item price: " + item.price());
		}
		System.out.println("Total Price: " + getTotalCost());
	}
	
	/**
	 * Get the room components
	 * @return
	 */
	public List<Item> getItems() {
		return items;
	}
	
	
}
